import 'package:http/http.dart';

Uri getUri(String url, {Map<String, dynamic>? paramMap}) {
  String baseUrl = "10.0.2.2:3000";
  // String baseUrl = "api.geekailab.com";
  if (paramMap != null) {
    return Uri.http(baseUrl, url, paramMap);
  } else {
    return Uri.http(baseUrl, url);
  }
}

bool isRespSuccess(Response response) {
  return [200, 201].contains(response.statusCode);
}

bool isRespDataSuccess(dynamic data) {
  return data['code'] == 200;
}
